package com.fanyue.modules.wzb.controller.admin;


import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.fanyue.core.annotation.CoolRestController;
import com.fanyue.core.exception.CoolPreconditions;
import com.fanyue.core.request.R;
import com.fanyue.core.util.CoolSecurityUtil;
import com.fanyue.modules.base.entity.sys.BaseSysParamEntity;
import com.fanyue.modules.base.entity.sys.BaseSysUserEntity;
import com.fanyue.modules.base.service.sys.BaseSysParamService;
import com.fanyue.modules.base.service.sys.BaseSysUserService;
import com.fanyue.modules.wzb.entity.AppUserEntity;
import com.fanyue.modules.wzb.entity.AppUserFaceRecordEntity;
import com.fanyue.modules.wzb.service.AppUserFaceRecordService;
import com.fanyue.modules.wzb.service.AppUserService;
import com.fanyue.modules.wzb.service.ClothingInfoService;
import com.fanyue.modules.wzb.service.CountService;
import com.fanyue.modules.wzb.utils.FaceApiUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;

import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RequiredArgsConstructor
@Tag(name = "用户信息", description = "用户信息")
@CoolRestController
public class CountController {

    private final CountService service;

    @Operation(summary = "当前借出统计")
    @PostMapping("/lendByAppUser")
    public R lendByAppUser(@RequestAttribute JSONObject requestParams) {
        return service.lendCountByAppUser(requestParams);
    }

    @Operation(summary = "型号统计")
    @PostMapping("/clothingBySpec")
    public R clothingBySpec(@RequestAttribute JSONObject requestParams) {
        return service.clothingBySpec(requestParams);
    }

    @Operation(summary = "类别统计")
    @PostMapping("/clothingByCategory")
    public R clothingByCategory(@RequestAttribute JSONObject requestParams) {
        return service.clothingByCategory(requestParams);
    }
}
